/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('linkwan', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AcceptJoinPermissionAuthOrderRequest {
  orderId?: string(name='OrderId'),
}

model AcceptJoinPermissionAuthOrderResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AcceptJoinPermissionAuthOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AcceptJoinPermissionAuthOrderResponseBody(name='body'),
}

async function acceptJoinPermissionAuthOrderWithOptions(request: AcceptJoinPermissionAuthOrderRequest, runtime: Util.RuntimeOptions): AcceptJoinPermissionAuthOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AcceptJoinPermissionAuthOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function acceptJoinPermissionAuthOrder(request: AcceptJoinPermissionAuthOrderRequest): AcceptJoinPermissionAuthOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return acceptJoinPermissionAuthOrderWithOptions(request, runtime);
}

model AddNodeToGroupRequest {
  devEui?: string(name='DevEui'),
  nodeGroupId?: string(name='NodeGroupId'),
  pinCode?: string(name='PinCode'),
}

model AddNodeToGroupResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddNodeToGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddNodeToGroupResponseBody(name='body'),
}

async function addNodeToGroupWithOptions(request: AddNodeToGroupRequest, runtime: Util.RuntimeOptions): AddNodeToGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  if (!Util.isUnset(request.pinCode)) {
    query['PinCode'] = request.pinCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddNodeToGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addNodeToGroup(request: AddNodeToGroupRequest): AddNodeToGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addNodeToGroupWithOptions(request, runtime);
}

model ApplyRoamingJoinPermissionRequest {
  classMode?: string(name='ClassMode'),
  dataRate?: long(name='DataRate'),
  freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
  joinPermissionName?: string(name='JoinPermissionName'),
  rxDelay?: long(name='RxDelay'),
}

model ApplyRoamingJoinPermissionResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ApplyRoamingJoinPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ApplyRoamingJoinPermissionResponseBody(name='body'),
}

async function applyRoamingJoinPermissionWithOptions(request: ApplyRoamingJoinPermissionRequest, runtime: Util.RuntimeOptions): ApplyRoamingJoinPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.classMode)) {
    query['ClassMode'] = request.classMode;
  }
  if (!Util.isUnset(request.dataRate)) {
    query['DataRate'] = request.dataRate;
  }
  if (!Util.isUnset(request.freqBandPlanGroupId)) {
    query['FreqBandPlanGroupId'] = request.freqBandPlanGroupId;
  }
  if (!Util.isUnset(request.joinPermissionName)) {
    query['JoinPermissionName'] = request.joinPermissionName;
  }
  if (!Util.isUnset(request.rxDelay)) {
    query['RxDelay'] = request.rxDelay;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApplyRoamingJoinPermission',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function applyRoamingJoinPermission(request: ApplyRoamingJoinPermissionRequest): ApplyRoamingJoinPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyRoamingJoinPermissionWithOptions(request, runtime);
}

model BindJoinPermissionToNodeGroupRequest {
  joinPermissionId?: string(name='JoinPermissionId'),
  nodeGroupId?: string(name='NodeGroupId'),
}

model BindJoinPermissionToNodeGroupResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model BindJoinPermissionToNodeGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BindJoinPermissionToNodeGroupResponseBody(name='body'),
}

async function bindJoinPermissionToNodeGroupWithOptions(request: BindJoinPermissionToNodeGroupRequest, runtime: Util.RuntimeOptions): BindJoinPermissionToNodeGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindJoinPermissionToNodeGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function bindJoinPermissionToNodeGroup(request: BindJoinPermissionToNodeGroupRequest): BindJoinPermissionToNodeGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindJoinPermissionToNodeGroupWithOptions(request, runtime);
}

model CancelJoinPermissionAuthOrderRequest {
  orderId?: string(name='OrderId'),
}

model CancelJoinPermissionAuthOrderResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CancelJoinPermissionAuthOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CancelJoinPermissionAuthOrderResponseBody(name='body'),
}

async function cancelJoinPermissionAuthOrderWithOptions(request: CancelJoinPermissionAuthOrderRequest, runtime: Util.RuntimeOptions): CancelJoinPermissionAuthOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelJoinPermissionAuthOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelJoinPermissionAuthOrder(request: CancelJoinPermissionAuthOrderRequest): CancelJoinPermissionAuthOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelJoinPermissionAuthOrderWithOptions(request, runtime);
}

model CheckCloudProductOpenStatusRequest {
  serviceCode?: string(name='ServiceCode'),
}

model CheckCloudProductOpenStatusResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CheckCloudProductOpenStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CheckCloudProductOpenStatusResponseBody(name='body'),
}

async function checkCloudProductOpenStatusWithOptions(request: CheckCloudProductOpenStatusRequest, runtime: Util.RuntimeOptions): CheckCloudProductOpenStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.serviceCode)) {
    query['ServiceCode'] = request.serviceCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckCloudProductOpenStatus',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkCloudProductOpenStatus(request: CheckCloudProductOpenStatusRequest): CheckCloudProductOpenStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkCloudProductOpenStatusWithOptions(request, runtime);
}

model CheckUserChargeStatusResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CheckUserChargeStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CheckUserChargeStatusResponseBody(name='body'),
}

async function checkUserChargeStatusWithOptions(runtime: Util.RuntimeOptions): CheckUserChargeStatusResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'CheckUserChargeStatus',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkUserChargeStatus(): CheckUserChargeStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkUserChargeStatusWithOptions(runtime);
}

model CountGatewayTupleOrdersRequest {
  states?: [ string ](name='States'),
}

model CountGatewayTupleOrdersResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountGatewayTupleOrdersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountGatewayTupleOrdersResponseBody(name='body'),
}

async function countGatewayTupleOrdersWithOptions(request: CountGatewayTupleOrdersRequest, runtime: Util.RuntimeOptions): CountGatewayTupleOrdersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.states)) {
    query['States'] = request.states;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountGatewayTupleOrders',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countGatewayTupleOrders(request: CountGatewayTupleOrdersRequest): CountGatewayTupleOrdersResponse {
  var runtime = new Util.RuntimeOptions{};
  return countGatewayTupleOrdersWithOptions(request, runtime);
}

model CountGatewaysRequest {
  freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
  fuzzyCity?: string(name='FuzzyCity'),
  fuzzyGwEui?: string(name='FuzzyGwEui'),
  fuzzyName?: string(name='FuzzyName'),
  iotInstanceId?: string(name='IotInstanceId'),
  isEnabled?: boolean(name='IsEnabled'),
  onlineState?: string(name='OnlineState'),
}

model CountGatewaysResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountGatewaysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountGatewaysResponseBody(name='body'),
}

async function countGatewaysWithOptions(request: CountGatewaysRequest, runtime: Util.RuntimeOptions): CountGatewaysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.freqBandPlanGroupId)) {
    query['FreqBandPlanGroupId'] = request.freqBandPlanGroupId;
  }
  if (!Util.isUnset(request.fuzzyCity)) {
    query['FuzzyCity'] = request.fuzzyCity;
  }
  if (!Util.isUnset(request.fuzzyGwEui)) {
    query['FuzzyGwEui'] = request.fuzzyGwEui;
  }
  if (!Util.isUnset(request.fuzzyName)) {
    query['FuzzyName'] = request.fuzzyName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isEnabled)) {
    query['IsEnabled'] = request.isEnabled;
  }
  if (!Util.isUnset(request.onlineState)) {
    query['OnlineState'] = request.onlineState;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountGateways',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countGateways(request: CountGatewaysRequest): CountGatewaysResponse {
  var runtime = new Util.RuntimeOptions{};
  return countGatewaysWithOptions(request, runtime);
}

model CountNodeGroupsRequest {
  fuzzyDevEui?: string(name='FuzzyDevEui'),
  fuzzyJoinEui?: string(name='FuzzyJoinEui'),
  fuzzyName?: string(name='FuzzyName'),
  iotInstanceId?: string(name='IotInstanceId'),
}

model CountNodeGroupsResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountNodeGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountNodeGroupsResponseBody(name='body'),
}

async function countNodeGroupsWithOptions(request: CountNodeGroupsRequest, runtime: Util.RuntimeOptions): CountNodeGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fuzzyDevEui)) {
    query['FuzzyDevEui'] = request.fuzzyDevEui;
  }
  if (!Util.isUnset(request.fuzzyJoinEui)) {
    query['FuzzyJoinEui'] = request.fuzzyJoinEui;
  }
  if (!Util.isUnset(request.fuzzyName)) {
    query['FuzzyName'] = request.fuzzyName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountNodeGroups',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countNodeGroups(request: CountNodeGroupsRequest): CountNodeGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return countNodeGroupsWithOptions(request, runtime);
}

model CountNodeTupleOrdersRequest {
  isKpm?: boolean(name='IsKpm'),
  states?: [ string ](name='States'),
}

model CountNodeTupleOrdersResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountNodeTupleOrdersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountNodeTupleOrdersResponseBody(name='body'),
}

async function countNodeTupleOrdersWithOptions(request: CountNodeTupleOrdersRequest, runtime: Util.RuntimeOptions): CountNodeTupleOrdersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isKpm)) {
    query['IsKpm'] = request.isKpm;
  }
  if (!Util.isUnset(request.states)) {
    query['States'] = request.states;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountNodeTupleOrders',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countNodeTupleOrders(request: CountNodeTupleOrdersRequest): CountNodeTupleOrdersResponse {
  var runtime = new Util.RuntimeOptions{};
  return countNodeTupleOrdersWithOptions(request, runtime);
}

model CountNodesByNodeGroupIdRequest {
  fuzzyDevEui?: string(name='FuzzyDevEui'),
  nodeGroupId?: string(name='NodeGroupId'),
}

model CountNodesByNodeGroupIdResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountNodesByNodeGroupIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountNodesByNodeGroupIdResponseBody(name='body'),
}

async function countNodesByNodeGroupIdWithOptions(request: CountNodesByNodeGroupIdRequest, runtime: Util.RuntimeOptions): CountNodesByNodeGroupIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fuzzyDevEui)) {
    query['FuzzyDevEui'] = request.fuzzyDevEui;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountNodesByNodeGroupId',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countNodesByNodeGroupId(request: CountNodesByNodeGroupIdRequest): CountNodesByNodeGroupIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return countNodesByNodeGroupIdWithOptions(request, runtime);
}

model CountNodesByOwnedJoinPermissionIdRequest {
  fuzzyDevEui?: string(name='FuzzyDevEui'),
  joinPermissionId?: string(name='JoinPermissionId'),
}

model CountNodesByOwnedJoinPermissionIdResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountNodesByOwnedJoinPermissionIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountNodesByOwnedJoinPermissionIdResponseBody(name='body'),
}

async function countNodesByOwnedJoinPermissionIdWithOptions(request: CountNodesByOwnedJoinPermissionIdRequest, runtime: Util.RuntimeOptions): CountNodesByOwnedJoinPermissionIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fuzzyDevEui)) {
    query['FuzzyDevEui'] = request.fuzzyDevEui;
  }
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountNodesByOwnedJoinPermissionId',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countNodesByOwnedJoinPermissionId(request: CountNodesByOwnedJoinPermissionIdRequest): CountNodesByOwnedJoinPermissionIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return countNodesByOwnedJoinPermissionIdWithOptions(request, runtime);
}

model CountNotificationsRequest {
  beginMillis?: long(name='BeginMillis'),
  category?: [ string ](name='Category'),
  endMillis?: long(name='EndMillis'),
  handleState?: string(name='HandleState'),
}

model CountNotificationsResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountNotificationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountNotificationsResponseBody(name='body'),
}

async function countNotificationsWithOptions(request: CountNotificationsRequest, runtime: Util.RuntimeOptions): CountNotificationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.handleState)) {
    query['HandleState'] = request.handleState;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountNotifications',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countNotifications(request: CountNotificationsRequest): CountNotificationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return countNotificationsWithOptions(request, runtime);
}

model CountOwnedJoinPermissionsRequest {
  enabled?: boolean(name='Enabled'),
  fuzzyJoinEui?: string(name='FuzzyJoinEui'),
  fuzzyJoinPermissionName?: string(name='FuzzyJoinPermissionName'),
  fuzzyRenterAliyunId?: string(name='FuzzyRenterAliyunId'),
}

model CountOwnedJoinPermissionsResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountOwnedJoinPermissionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountOwnedJoinPermissionsResponseBody(name='body'),
}

async function countOwnedJoinPermissionsWithOptions(request: CountOwnedJoinPermissionsRequest, runtime: Util.RuntimeOptions): CountOwnedJoinPermissionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.fuzzyJoinEui)) {
    query['FuzzyJoinEui'] = request.fuzzyJoinEui;
  }
  if (!Util.isUnset(request.fuzzyJoinPermissionName)) {
    query['FuzzyJoinPermissionName'] = request.fuzzyJoinPermissionName;
  }
  if (!Util.isUnset(request.fuzzyRenterAliyunId)) {
    query['FuzzyRenterAliyunId'] = request.fuzzyRenterAliyunId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountOwnedJoinPermissions',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countOwnedJoinPermissions(request: CountOwnedJoinPermissionsRequest): CountOwnedJoinPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return countOwnedJoinPermissionsWithOptions(request, runtime);
}

model CountRentedJoinPermissionsRequest {
  boundNodeGroup?: boolean(name='BoundNodeGroup'),
  enabled?: boolean(name='Enabled'),
  fuzzyJoinEui?: string(name='FuzzyJoinEui'),
  fuzzyJoinPermissionName?: string(name='FuzzyJoinPermissionName'),
  fuzzyOwnerAliyunId?: string(name='FuzzyOwnerAliyunId'),
  type?: string(name='Type'),
}

model CountRentedJoinPermissionsResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CountRentedJoinPermissionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountRentedJoinPermissionsResponseBody(name='body'),
}

async function countRentedJoinPermissionsWithOptions(request: CountRentedJoinPermissionsRequest, runtime: Util.RuntimeOptions): CountRentedJoinPermissionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.boundNodeGroup)) {
    query['BoundNodeGroup'] = request.boundNodeGroup;
  }
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.fuzzyJoinEui)) {
    query['FuzzyJoinEui'] = request.fuzzyJoinEui;
  }
  if (!Util.isUnset(request.fuzzyJoinPermissionName)) {
    query['FuzzyJoinPermissionName'] = request.fuzzyJoinPermissionName;
  }
  if (!Util.isUnset(request.fuzzyOwnerAliyunId)) {
    query['FuzzyOwnerAliyunId'] = request.fuzzyOwnerAliyunId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountRentedJoinPermissions',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countRentedJoinPermissions(request: CountRentedJoinPermissionsRequest): CountRentedJoinPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return countRentedJoinPermissionsWithOptions(request, runtime);
}

model CreateGatewayRequest {
  address?: string(name='Address'),
  addressCode?: long(name='AddressCode'),
  city?: string(name='City'),
  communicationMode?: string(name='CommunicationMode'),
  description?: string(name='Description'),
  district?: string(name='District'),
  freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
  gisCoordinateSystem?: string(name='GisCoordinateSystem'),
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  latitude?: float(name='Latitude'),
  longitude?: float(name='Longitude'),
  name?: string(name='Name'),
  pinCode?: string(name='PinCode'),
}

model CreateGatewayResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateGatewayResponseBody(name='body'),
}

async function createGatewayWithOptions(request: CreateGatewayRequest, runtime: Util.RuntimeOptions): CreateGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.addressCode)) {
    query['AddressCode'] = request.addressCode;
  }
  if (!Util.isUnset(request.city)) {
    query['City'] = request.city;
  }
  if (!Util.isUnset(request.communicationMode)) {
    query['CommunicationMode'] = request.communicationMode;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.district)) {
    query['District'] = request.district;
  }
  if (!Util.isUnset(request.freqBandPlanGroupId)) {
    query['FreqBandPlanGroupId'] = request.freqBandPlanGroupId;
  }
  if (!Util.isUnset(request.gisCoordinateSystem)) {
    query['GisCoordinateSystem'] = request.gisCoordinateSystem;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.latitude)) {
    query['Latitude'] = request.latitude;
  }
  if (!Util.isUnset(request.longitude)) {
    query['Longitude'] = request.longitude;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pinCode)) {
    query['PinCode'] = request.pinCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateGateway',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createGateway(request: CreateGatewayRequest): CreateGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGatewayWithOptions(request, runtime);
}

model CreateLocalJoinPermissionRequest {
  classMode?: string(name='ClassMode'),
  dataRate?: long(name='DataRate'),
  freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
  iotInstanceId?: string(name='IotInstanceId'),
  joinEui?: string(name='JoinEui'),
  joinPermissionName?: string(name='JoinPermissionName'),
  rxDelay?: long(name='RxDelay'),
  useDefaultJoinEui?: boolean(name='UseDefaultJoinEui'),
}

model CreateLocalJoinPermissionResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateLocalJoinPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateLocalJoinPermissionResponseBody(name='body'),
}

async function createLocalJoinPermissionWithOptions(request: CreateLocalJoinPermissionRequest, runtime: Util.RuntimeOptions): CreateLocalJoinPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.classMode)) {
    query['ClassMode'] = request.classMode;
  }
  if (!Util.isUnset(request.dataRate)) {
    query['DataRate'] = request.dataRate;
  }
  if (!Util.isUnset(request.freqBandPlanGroupId)) {
    query['FreqBandPlanGroupId'] = request.freqBandPlanGroupId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.joinEui)) {
    query['JoinEui'] = request.joinEui;
  }
  if (!Util.isUnset(request.joinPermissionName)) {
    query['JoinPermissionName'] = request.joinPermissionName;
  }
  if (!Util.isUnset(request.rxDelay)) {
    query['RxDelay'] = request.rxDelay;
  }
  if (!Util.isUnset(request.useDefaultJoinEui)) {
    query['UseDefaultJoinEui'] = request.useDefaultJoinEui;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateLocalJoinPermission',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createLocalJoinPermission(request: CreateLocalJoinPermissionRequest): CreateLocalJoinPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLocalJoinPermissionWithOptions(request, runtime);
}

model CreateNodeGroupRequest {
  joinPermissionId?: string(name='JoinPermissionId'),
  nodeGroupName?: string(name='NodeGroupName'),
}

model CreateNodeGroupResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateNodeGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateNodeGroupResponseBody(name='body'),
}

async function createNodeGroupWithOptions(request: CreateNodeGroupRequest, runtime: Util.RuntimeOptions): CreateNodeGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  if (!Util.isUnset(request.nodeGroupName)) {
    query['NodeGroupName'] = request.nodeGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateNodeGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createNodeGroup(request: CreateNodeGroupRequest): CreateNodeGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createNodeGroupWithOptions(request, runtime);
}

model DeleteGatewayRequest {
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
}

model DeleteGatewayResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteGatewayResponseBody(name='body'),
}

async function deleteGatewayWithOptions(request: DeleteGatewayRequest, runtime: Util.RuntimeOptions): DeleteGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteGateway',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteGateway(request: DeleteGatewayRequest): DeleteGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGatewayWithOptions(request, runtime);
}

model DeleteLocalJoinPermissionRequest {
  iotInstanceId?: string(name='IotInstanceId'),
  joinPermissionId?: string(name='JoinPermissionId'),
}

model DeleteLocalJoinPermissionResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteLocalJoinPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteLocalJoinPermissionResponseBody(name='body'),
}

async function deleteLocalJoinPermissionWithOptions(request: DeleteLocalJoinPermissionRequest, runtime: Util.RuntimeOptions): DeleteLocalJoinPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLocalJoinPermission',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteLocalJoinPermission(request: DeleteLocalJoinPermissionRequest): DeleteLocalJoinPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLocalJoinPermissionWithOptions(request, runtime);
}

model DeleteNodeGroupRequest {
  nodeGroupId?: string(name='NodeGroupId'),
}

model DeleteNodeGroupResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteNodeGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteNodeGroupResponseBody(name='body'),
}

async function deleteNodeGroupWithOptions(request: DeleteNodeGroupRequest, runtime: Util.RuntimeOptions): DeleteNodeGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteNodeGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteNodeGroup(request: DeleteNodeGroupRequest): DeleteNodeGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteNodeGroupWithOptions(request, runtime);
}

model GetFreqBandPlanGroupRequest {
  groupId?: long(name='GroupId'),
}

model GetFreqBandPlanGroupResponseBody = {
  data?: {
    beginFrequency?: long(name='BeginFrequency'),
    endFrequency?: long(name='EndFrequency'),
    frequencyRegionId?: string(name='FrequencyRegionId'),
    frequencyType?: string(name='FrequencyType'),
    groupId?: long(name='GroupId'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetFreqBandPlanGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFreqBandPlanGroupResponseBody(name='body'),
}

async function getFreqBandPlanGroupWithOptions(request: GetFreqBandPlanGroupRequest, runtime: Util.RuntimeOptions): GetFreqBandPlanGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFreqBandPlanGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFreqBandPlanGroup(request: GetFreqBandPlanGroupRequest): GetFreqBandPlanGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFreqBandPlanGroupWithOptions(request, runtime);
}

model GetGatewayRequest {
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
}

model GetGatewayResponseBody = {
  data?: {
    address?: string(name='Address'),
    addressCode?: long(name='AddressCode'),
    authTypes?: string(name='AuthTypes'),
    chargeStatus?: string(name='ChargeStatus'),
    city?: string(name='City'),
    classBSupported?: boolean(name='ClassBSupported'),
    classBWorking?: boolean(name='ClassBWorking'),
    communicationMode?: string(name='CommunicationMode'),
    description?: string(name='Description'),
    district?: string(name='District'),
    embeddedNsId?: string(name='EmbeddedNsId'),
    enabled?: boolean(name='Enabled'),
    freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
    gisCoordinateSystem?: string(name='GisCoordinateSystem'),
    gwEui?: string(name='GwEui'),
    latitude?: float(name='Latitude'),
    longitude?: float(name='Longitude'),
    name?: string(name='Name'),
    onlineState?: string(name='OnlineState'),
    onlineStateChangedMillis?: long(name='OnlineStateChangedMillis'),
    timeCorrectable?: boolean(name='TimeCorrectable'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetGatewayResponseBody(name='body'),
}

async function getGatewayWithOptions(request: GetGatewayRequest, runtime: Util.RuntimeOptions): GetGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetGateway',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getGateway(request: GetGatewayRequest): GetGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return getGatewayWithOptions(request, runtime);
}

model GetGatewayPacketStatRequest {
  beginMillis?: long(name='BeginMillis'),
  endMillis?: long(name='EndMillis'),
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
}

model GetGatewayPacketStatResponseBody = {
  data?: {
    downlinkInvalid?: int32(name='DownlinkInvalid'),
    downlinkValid?: int32(name='DownlinkValid'),
    uplinkInvalid?: int32(name='UplinkInvalid'),
    uplinkValid?: int32(name='UplinkValid'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetGatewayPacketStatResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetGatewayPacketStatResponseBody(name='body'),
}

async function getGatewayPacketStatWithOptions(request: GetGatewayPacketStatRequest, runtime: Util.RuntimeOptions): GetGatewayPacketStatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetGatewayPacketStat',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getGatewayPacketStat(request: GetGatewayPacketStatRequest): GetGatewayPacketStatResponse {
  var runtime = new Util.RuntimeOptions{};
  return getGatewayPacketStatWithOptions(request, runtime);
}

model GetGatewayStatusStatRequest {
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
}

model GetGatewayStatusStatResponseBody = {
  data?: {
    cpuRadio?: float(name='CpuRadio'),
    enabled?: boolean(name='Enabled'),
    gwEui?: string(name='GwEui'),
    memoryRadio?: float(name='MemoryRadio'),
    onlineHour?: long(name='OnlineHour'),
    onlineState?: string(name='OnlineState'),
    rxCount?: long(name='RxCount'),
    txCount?: long(name='TxCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetGatewayStatusStatResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetGatewayStatusStatResponseBody(name='body'),
}

async function getGatewayStatusStatWithOptions(request: GetGatewayStatusStatRequest, runtime: Util.RuntimeOptions): GetGatewayStatusStatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetGatewayStatusStat',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getGatewayStatusStat(request: GetGatewayStatusStatRequest): GetGatewayStatusStatResponse {
  var runtime = new Util.RuntimeOptions{};
  return getGatewayStatusStatWithOptions(request, runtime);
}

model GetGatewayTransferPacketsDownloadUrlRequest {
  ascending?: boolean(name='Ascending'),
  beginMillis?: long(name='BeginMillis'),
  category?: string(name='Category'),
  devEui?: string(name='DevEui'),
  endMillis?: long(name='EndMillis'),
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  sortingField?: string(name='SortingField'),
}

model GetGatewayTransferPacketsDownloadUrlResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetGatewayTransferPacketsDownloadUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetGatewayTransferPacketsDownloadUrlResponseBody(name='body'),
}

async function getGatewayTransferPacketsDownloadUrlWithOptions(request: GetGatewayTransferPacketsDownloadUrlRequest, runtime: Util.RuntimeOptions): GetGatewayTransferPacketsDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetGatewayTransferPacketsDownloadUrl',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getGatewayTransferPacketsDownloadUrl(request: GetGatewayTransferPacketsDownloadUrlRequest): GetGatewayTransferPacketsDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getGatewayTransferPacketsDownloadUrlWithOptions(request, runtime);
}

model GetGatewayTupleOrderRequest {
  orderId?: string(name='OrderId'),
}

model GetGatewayTupleOrderResponseBody = {
  data?: {
    acceptedMillis?: long(name='AcceptedMillis'),
    createdMillis?: long(name='CreatedMillis'),
    orderId?: string(name='OrderId'),
    orderState?: string(name='OrderState'),
    requiredCount?: long(name='RequiredCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetGatewayTupleOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetGatewayTupleOrderResponseBody(name='body'),
}

async function getGatewayTupleOrderWithOptions(request: GetGatewayTupleOrderRequest, runtime: Util.RuntimeOptions): GetGatewayTupleOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetGatewayTupleOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getGatewayTupleOrder(request: GetGatewayTupleOrderRequest): GetGatewayTupleOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return getGatewayTupleOrderWithOptions(request, runtime);
}

model GetGatewayTuplesDownloadUrlRequest {
  orderId?: string(name='OrderId'),
}

model GetGatewayTuplesDownloadUrlResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetGatewayTuplesDownloadUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetGatewayTuplesDownloadUrlResponseBody(name='body'),
}

async function getGatewayTuplesDownloadUrlWithOptions(request: GetGatewayTuplesDownloadUrlRequest, runtime: Util.RuntimeOptions): GetGatewayTuplesDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetGatewayTuplesDownloadUrl',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getGatewayTuplesDownloadUrl(request: GetGatewayTuplesDownloadUrlRequest): GetGatewayTuplesDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getGatewayTuplesDownloadUrlWithOptions(request, runtime);
}

model GetJoinPermissionAuthOrderRequest {
  orderId?: string(name='OrderId'),
}

model GetJoinPermissionAuthOrderResponseBody = {
  data?: {
    acceptedMillis?: long(name='AcceptedMillis'),
    applyingMillis?: long(name='ApplyingMillis'),
    canceledMillis?: long(name='CanceledMillis'),
    joinPermissionId?: string(name='JoinPermissionId'),
    orderId?: string(name='OrderId'),
    orderState?: string(name='OrderState'),
    ownerAliyunId?: string(name='OwnerAliyunId'),
    rejectedMillis?: long(name='RejectedMillis'),
    renterAliyunId?: string(name='RenterAliyunId'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetJoinPermissionAuthOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetJoinPermissionAuthOrderResponseBody(name='body'),
}

async function getJoinPermissionAuthOrderWithOptions(request: GetJoinPermissionAuthOrderRequest, runtime: Util.RuntimeOptions): GetJoinPermissionAuthOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJoinPermissionAuthOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getJoinPermissionAuthOrder(request: GetJoinPermissionAuthOrderRequest): GetJoinPermissionAuthOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJoinPermissionAuthOrderWithOptions(request, runtime);
}

model GetNodeRequest {
  devEui?: string(name='DevEui'),
}

model GetNodeResponseBody = {
  data?: {
    authTypes?: string(name='AuthTypes'),
    boundMillis?: long(name='BoundMillis'),
    classMode?: string(name='ClassMode'),
    devAddr?: string(name='DevAddr'),
    devEui?: string(name='DevEui'),
    lastJoinMillis?: long(name='LastJoinMillis'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetNodeResponseBody(name='body'),
}

async function getNodeWithOptions(request: GetNodeRequest, runtime: Util.RuntimeOptions): GetNodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNode',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getNode(request: GetNodeRequest): GetNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNodeWithOptions(request, runtime);
}

model GetNodeGroupRequest {
  iotInstanceId?: string(name='IotInstanceId'),
  nodeGroupId?: string(name='NodeGroupId'),
}

model GetNodeGroupResponseBody = {
  data?: {
    classMode?: string(name='ClassMode'),
    createMillis?: long(name='CreateMillis'),
    dataDispatchConfig?: {
      destination?: string(name='Destination'),
      iotProduct?: {
        debugSwitch?: boolean(name='DebugSwitch'),
        productKey?: string(name='ProductKey'),
        productName?: string(name='ProductName'),
        productType?: string(name='ProductType'),
      }(name='IotProduct'),
      onsTopics?: {
        downlinkRegionName?: string(name='DownlinkRegionName'),
        downlinkTopic?: string(name='DownlinkTopic'),
        uplinkRegionName?: string(name='UplinkRegionName'),
        uplinkTopic?: string(name='UplinkTopic'),
      }(name='OnsTopics'),
    }(name='DataDispatchConfig'),
    dataDispatchEnabled?: boolean(name='DataDispatchEnabled'),
    freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
    joinEui?: string(name='JoinEui'),
    joinPermissionEnabled?: boolean(name='JoinPermissionEnabled'),
    joinPermissionId?: string(name='JoinPermissionId'),
    joinPermissionName?: string(name='JoinPermissionName'),
    joinPermissionOwnerAliyunId?: string(name='JoinPermissionOwnerAliyunId'),
    joinPermissionType?: string(name='JoinPermissionType'),
    locks?: [ 
      {
        createMillis?: long(name='CreateMillis'),
        enabled?: boolean(name='Enabled'),
        lockId?: string(name='LockId'),
        lockType?: string(name='LockType'),
      }
    ](name='Locks'),
    multicastEnabled?: boolean(name='MulticastEnabled'),
    multicastGroupId?: string(name='MulticastGroupId'),
    multicastNodeCapacity?: int32(name='MulticastNodeCapacity'),
    multicastNodeCount?: int32(name='MulticastNodeCount'),
    nodeGroupId?: string(name='NodeGroupId'),
    nodeGroupName?: string(name='NodeGroupName'),
    nodesCnt?: long(name='NodesCnt'),
    rxDailySum?: string(name='RxDailySum'),
    rxMonthSum?: long(name='RxMonthSum'),
    txDailySum?: long(name='TxDailySum'),
    txMonthSum?: long(name='TxMonthSum'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNodeGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetNodeGroupResponseBody(name='body'),
}

async function getNodeGroupWithOptions(request: GetNodeGroupRequest, runtime: Util.RuntimeOptions): GetNodeGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNodeGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getNodeGroup(request: GetNodeGroupRequest): GetNodeGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNodeGroupWithOptions(request, runtime);
}

model GetNodeGroupTransferPacketsDownloadUrlRequest {
  ascending?: boolean(name='Ascending'),
  beginMillis?: long(name='BeginMillis'),
  category?: string(name='Category'),
  devEui?: string(name='DevEui'),
  endMillis?: long(name='EndMillis'),
  iotInstanceId?: string(name='IotInstanceId'),
  nodeGroupId?: string(name='NodeGroupId'),
  sortingField?: string(name='SortingField'),
}

model GetNodeGroupTransferPacketsDownloadUrlResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNodeGroupTransferPacketsDownloadUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetNodeGroupTransferPacketsDownloadUrlResponseBody(name='body'),
}

async function getNodeGroupTransferPacketsDownloadUrlWithOptions(request: GetNodeGroupTransferPacketsDownloadUrlRequest, runtime: Util.RuntimeOptions): GetNodeGroupTransferPacketsDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNodeGroupTransferPacketsDownloadUrl',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getNodeGroupTransferPacketsDownloadUrl(request: GetNodeGroupTransferPacketsDownloadUrlRequest): GetNodeGroupTransferPacketsDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNodeGroupTransferPacketsDownloadUrlWithOptions(request, runtime);
}

model GetNodeTransferPacketRequest {
  base64EncodedMacPayload?: string(name='Base64EncodedMacPayload'),
  devEui?: string(name='DevEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  logMillis?: long(name='LogMillis'),
}

model GetNodeTransferPacketResponseBody = {
  data?: {
    base64EncodedMacPayload?: string(name='Base64EncodedMacPayload'),
    classMode?: string(name='ClassMode'),
    datr?: string(name='Datr'),
    devAddr?: string(name='DevAddr'),
    devEui?: string(name='DevEui'),
    FPort?: int32(name='FPort'),
    freq?: float(name='Freq'),
    freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
    gwEui?: string(name='GwEui'),
    gwOwnerAliyunId?: string(name='GwOwnerAliyunId'),
    hasData?: boolean(name='HasData'),
    hasMacCommand?: boolean(name='HasMacCommand'),
    logMillis?: long(name='LogMillis'),
    lsnr?: float(name='Lsnr'),
    macCommandCIDs?: [  map[string]any ](name='MacCommandCIDs'),
    macPayloadSize?: int32(name='MacPayloadSize'),
    messageType?: string(name='MessageType'),
    processEvent?: string(name='ProcessEvent'),
    rssi?: int32(name='Rssi'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNodeTransferPacketResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetNodeTransferPacketResponseBody(name='body'),
}

async function getNodeTransferPacketWithOptions(request: GetNodeTransferPacketRequest, runtime: Util.RuntimeOptions): GetNodeTransferPacketResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.base64EncodedMacPayload)) {
    query['Base64EncodedMacPayload'] = request.base64EncodedMacPayload;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.logMillis)) {
    query['LogMillis'] = request.logMillis;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNodeTransferPacket',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getNodeTransferPacket(request: GetNodeTransferPacketRequest): GetNodeTransferPacketResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNodeTransferPacketWithOptions(request, runtime);
}

model GetNodeTransferPacketsDownloadUrlRequest {
  ascending?: boolean(name='Ascending'),
  beginMillis?: long(name='BeginMillis'),
  category?: string(name='Category'),
  devEui?: string(name='DevEui'),
  endMillis?: long(name='EndMillis'),
  gwEui?: string(name='GwEui'),
  sortingField?: string(name='SortingField'),
}

model GetNodeTransferPacketsDownloadUrlResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNodeTransferPacketsDownloadUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetNodeTransferPacketsDownloadUrlResponseBody(name='body'),
}

async function getNodeTransferPacketsDownloadUrlWithOptions(request: GetNodeTransferPacketsDownloadUrlRequest, runtime: Util.RuntimeOptions): GetNodeTransferPacketsDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNodeTransferPacketsDownloadUrl',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getNodeTransferPacketsDownloadUrl(request: GetNodeTransferPacketsDownloadUrlRequest): GetNodeTransferPacketsDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNodeTransferPacketsDownloadUrlWithOptions(request, runtime);
}

model GetNodeTupleOrderRequest {
  orderId?: string(name='OrderId'),
}

model GetNodeTupleOrderResponseBody = {
  data?: {
    acceptedMillis?: long(name='AcceptedMillis'),
    createdMillis?: long(name='CreatedMillis'),
    isKpm?: boolean(name='IsKpm'),
    orderId?: string(name='OrderId'),
    orderState?: string(name='OrderState'),
    requiredCount?: long(name='RequiredCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNodeTupleOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetNodeTupleOrderResponseBody(name='body'),
}

async function getNodeTupleOrderWithOptions(request: GetNodeTupleOrderRequest, runtime: Util.RuntimeOptions): GetNodeTupleOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNodeTupleOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getNodeTupleOrder(request: GetNodeTupleOrderRequest): GetNodeTupleOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNodeTupleOrderWithOptions(request, runtime);
}

model GetNodeTuplesDownloadUrlRequest {
  orderId?: string(name='OrderId'),
}

model GetNodeTuplesDownloadUrlResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNodeTuplesDownloadUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetNodeTuplesDownloadUrlResponseBody(name='body'),
}

async function getNodeTuplesDownloadUrlWithOptions(request: GetNodeTuplesDownloadUrlRequest, runtime: Util.RuntimeOptions): GetNodeTuplesDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNodeTuplesDownloadUrl',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getNodeTuplesDownloadUrl(request: GetNodeTuplesDownloadUrlRequest): GetNodeTuplesDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNodeTuplesDownloadUrlWithOptions(request, runtime);
}

model GetNotificationRequest {
  notificationId?: string(name='NotificationId'),
}

model GetNotificationResponseBody = {
  data?: {
    category?: string(name='Category'),
    gatewayOfflineInfo?: {
      gwEui?: string(name='GwEui'),
      offlineMillis?: long(name='OfflineMillis'),
    }(name='GatewayOfflineInfo'),
    handleState?: string(name='HandleState'),
    handledMillis?: long(name='HandledMillis'),
    joinPermissionAuthInfo?: {
      acceptedMillis?: long(name='AcceptedMillis'),
      applyingMillis?: long(name='ApplyingMillis'),
      canceledMillis?: long(name='CanceledMillis'),
      joinEui?: string(name='JoinEui'),
      joinPermissionId?: string(name='JoinPermissionId'),
      joinPermissionName?: string(name='JoinPermissionName'),
      orderId?: string(name='OrderId'),
      orderState?: string(name='OrderState'),
      ownerAliyunId?: string(name='OwnerAliyunId'),
      rejectedMillis?: long(name='RejectedMillis'),
      renterAliyunId?: string(name='RenterAliyunId'),
    }(name='JoinPermissionAuthInfo'),
    noticeMillis?: long(name='NoticeMillis'),
    notificationId?: string(name='NotificationId'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNotificationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetNotificationResponseBody(name='body'),
}

async function getNotificationWithOptions(request: GetNotificationRequest, runtime: Util.RuntimeOptions): GetNotificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.notificationId)) {
    query['NotificationId'] = request.notificationId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNotification',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getNotification(request: GetNotificationRequest): GetNotificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNotificationWithOptions(request, runtime);
}

model GetOwnedJoinPermissionRequest {
  iotInstanceId?: string(name='IotInstanceId'),
  joinPermissionId?: string(name='JoinPermissionId'),
}

model GetOwnedJoinPermissionResponseBody = {
  data?: {
    authState?: string(name='AuthState'),
    boundProductName?: string(name='BoundProductName'),
    classMode?: string(name='ClassMode'),
    createMillis?: long(name='CreateMillis'),
    dataDispatchDestination?: string(name='DataDispatchDestination'),
    dataRate?: long(name='DataRate'),
    enabled?: boolean(name='Enabled'),
    freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
    joinEui?: string(name='JoinEui'),
    joinPermissionId?: string(name='JoinPermissionId'),
    joinPermissionName?: string(name='JoinPermissionName'),
    multicastEnabled?: boolean(name='MulticastEnabled'),
    multicastNodeCapacity?: int32(name='MulticastNodeCapacity'),
    multicastNodeCount?: int32(name='MulticastNodeCount'),
    nodesCnt?: long(name='NodesCnt'),
    renterAliyunId?: string(name='RenterAliyunId'),
    rxDailySum?: long(name='RxDailySum'),
    rxDelay?: long(name='RxDelay'),
    rxMonthSum?: long(name='RxMonthSum'),
    txDailySum?: long(name='TxDailySum'),
    txMonthSum?: long(name='TxMonthSum'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetOwnedJoinPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetOwnedJoinPermissionResponseBody(name='body'),
}

async function getOwnedJoinPermissionWithOptions(request: GetOwnedJoinPermissionRequest, runtime: Util.RuntimeOptions): GetOwnedJoinPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOwnedJoinPermission',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOwnedJoinPermission(request: GetOwnedJoinPermissionRequest): GetOwnedJoinPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOwnedJoinPermissionWithOptions(request, runtime);
}

model GetRentedJoinPermissionRequest {
  joinPermissionId?: string(name='JoinPermissionId'),
}

model GetRentedJoinPermissionResponseBody = {
  data?: {
    boundNodeGroupId?: string(name='BoundNodeGroupId'),
    boundNodeGroupName?: string(name='BoundNodeGroupName'),
    classMode?: string(name='ClassMode'),
    createMillis?: long(name='CreateMillis'),
    dataRate?: long(name='DataRate'),
    enabled?: boolean(name='Enabled'),
    freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
    joinEui?: string(name='JoinEui'),
    joinPermissionId?: string(name='JoinPermissionId'),
    joinPermissionName?: string(name='JoinPermissionName'),
    nodesCnt?: long(name='NodesCnt'),
    rxDailySum?: long(name='RxDailySum'),
    rxDelay?: long(name='RxDelay'),
    rxMonthSum?: long(name='RxMonthSum'),
    txDailySum?: long(name='TxDailySum'),
    txMonthSum?: long(name='TxMonthSum'),
    type?: string(name='Type'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetRentedJoinPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetRentedJoinPermissionResponseBody(name='body'),
}

async function getRentedJoinPermissionWithOptions(request: GetRentedJoinPermissionRequest, runtime: Util.RuntimeOptions): GetRentedJoinPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRentedJoinPermission',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRentedJoinPermission(request: GetRentedJoinPermissionRequest): GetRentedJoinPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRentedJoinPermissionWithOptions(request, runtime);
}

model GetUserLicenseResponseBody = {
  data?: {
    gatewayCount?: long(name='GatewayCount'),
    gatewayDingTalkCount?: long(name='GatewayDingTalkCount'),
    gatewayDingTalkLimit?: long(name='GatewayDingTalkLimit'),
    gatewayFreeLimit?: long(name='GatewayFreeLimit'),
    gatewayLimit?: long(name='GatewayLimit'),
    gatewayPrePayCount?: long(name='GatewayPrePayCount'),
    gatewayProfessionalCount?: long(name='GatewayProfessionalCount'),
    gatewayProfessionalLimit?: long(name='GatewayProfessionalLimit'),
    gatewayTupleCount?: long(name='GatewayTupleCount'),
    gatewayTupleFreeLimit?: long(name='GatewayTupleFreeLimit'),
    gatewayTupleHybridCount?: long(name='GatewayTupleHybridCount'),
    gatewayTupleHybridLimit?: long(name='GatewayTupleHybridLimit'),
    gatewayTupleLimit?: long(name='GatewayTupleLimit'),
    gatewayTupleSingleChannelCount?: long(name='GatewayTupleSingleChannelCount'),
    gatewayTupleSingleChannelLimit?: long(name='GatewayTupleSingleChannelLimit'),
    gatewayTupleStandardCount?: long(name='GatewayTupleStandardCount'),
    gatewayTupleStandardLimit?: long(name='GatewayTupleStandardLimit'),
    localJoinPermissionCount?: long(name='LocalJoinPermissionCount'),
    localJoinPermissionFreeLimit?: long(name='LocalJoinPermissionFreeLimit'),
    localJoinPermissionLimit?: long(name='LocalJoinPermissionLimit'),
    nodeCount?: long(name='NodeCount'),
    nodeFreeLimit?: long(name='NodeFreeLimit'),
    nodeLimit?: long(name='NodeLimit'),
    nodeTupleCount?: long(name='NodeTupleCount'),
    nodeTupleFreeLimit?: long(name='NodeTupleFreeLimit'),
    nodeTupleLimit?: long(name='NodeTupleLimit'),
    nodeTupleRelayCount?: long(name='NodeTupleRelayCount'),
    nodeTupleRelayLimit?: long(name='NodeTupleRelayLimit'),
    nodeTupleStandardCount?: long(name='NodeTupleStandardCount'),
    nodeTupleStandardLimit?: long(name='NodeTupleStandardLimit'),
    oui?: string(name='Oui'),
    relayCount?: long(name='RelayCount'),
    relayLimit?: long(name='RelayLimit'),
    roamingJoinPermissionCount?: long(name='RoamingJoinPermissionCount'),
    roamingJoinPermissionFreeLimit?: long(name='RoamingJoinPermissionFreeLimit'),
    roamingJoinPermissionLimit?: long(name='RoamingJoinPermissionLimit'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetUserLicenseResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUserLicenseResponseBody(name='body'),
}

async function getUserLicenseWithOptions(runtime: Util.RuntimeOptions): GetUserLicenseResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetUserLicense',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserLicense(): GetUserLicenseResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserLicenseWithOptions(runtime);
}

model ListActivatedFeaturesRequest {
  environment?: string(name='Environment'),
}

model ListActivatedFeaturesResponseBody = {
  data?: [ string ](name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListActivatedFeaturesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListActivatedFeaturesResponseBody(name='body'),
}

async function listActivatedFeaturesWithOptions(request: ListActivatedFeaturesRequest, runtime: Util.RuntimeOptions): ListActivatedFeaturesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListActivatedFeatures',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listActivatedFeatures(request: ListActivatedFeaturesRequest): ListActivatedFeaturesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listActivatedFeaturesWithOptions(request, runtime);
}

model ListActiveGatewaysResponseBody = {
  data?: [ 
    {
      address?: string(name='Address'),
      addressCode?: long(name='AddressCode'),
      chargeStatus?: string(name='ChargeStatus'),
      city?: string(name='City'),
      communicationMode?: string(name='CommunicationMode'),
      description?: string(name='Description'),
      district?: string(name='District'),
      freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
      gisCoordinateSystem?: string(name='GisCoordinateSystem'),
      gwEui?: string(name='GwEui'),
      latitude?: float(name='Latitude'),
      longitude?: float(name='Longitude'),
      name?: string(name='Name'),
      onlineState?: string(name='OnlineState'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListActiveGatewaysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListActiveGatewaysResponseBody(name='body'),
}

async function listActiveGatewaysWithOptions(runtime: Util.RuntimeOptions): ListActiveGatewaysResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListActiveGateways',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listActiveGateways(): ListActiveGatewaysResponse {
  var runtime = new Util.RuntimeOptions{};
  return listActiveGatewaysWithOptions(runtime);
}

model ListFreqBandPlanGroupsResponseBody = {
  data?: [ 
    {
      beginFrequency?: long(name='BeginFrequency'),
      endFrequency?: long(name='EndFrequency'),
      frequencyRegionId?: string(name='FrequencyRegionId'),
      frequencyType?: string(name='FrequencyType'),
      groupId?: long(name='GroupId'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListFreqBandPlanGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListFreqBandPlanGroupsResponseBody(name='body'),
}

async function listFreqBandPlanGroupsWithOptions(runtime: Util.RuntimeOptions): ListFreqBandPlanGroupsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListFreqBandPlanGroups',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFreqBandPlanGroups(): ListFreqBandPlanGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFreqBandPlanGroupsWithOptions(runtime);
}

model ListGatewayOnlineRecordsRequest {
  ascending?: boolean(name='Ascending'),
  gwEui?: string(name='GwEui'),
  limit?: long(name='Limit'),
  offSet?: long(name='OffSet'),
  sortingField?: string(name='SortingField'),
}

model ListGatewayOnlineRecordsResponseBody = {
  data?: {
    list?: [ 
      {
        gwEui?: string(name='GwEui'),
        onlineState?: string(name='OnlineState'),
        stateChangedMillis?: long(name='StateChangedMillis'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGatewayOnlineRecordsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGatewayOnlineRecordsResponseBody(name='body'),
}

async function listGatewayOnlineRecordsWithOptions(request: ListGatewayOnlineRecordsRequest, runtime: Util.RuntimeOptions): ListGatewayOnlineRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offSet)) {
    query['OffSet'] = request.offSet;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGatewayOnlineRecords',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGatewayOnlineRecords(request: ListGatewayOnlineRecordsRequest): ListGatewayOnlineRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGatewayOnlineRecordsWithOptions(request, runtime);
}

model ListGatewayTransferFlowStatsRequest {
  beginMillis?: long(name='BeginMillis'),
  endMillis?: long(name='EndMillis'),
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  timeIntervalUnit?: string(name='TimeIntervalUnit'),
}

model ListGatewayTransferFlowStatsResponseBody = {
  data?: [ 
    {
      downlinkCount?: long(name='DownlinkCount'),
      statMillis?: string(name='StatMillis'),
      uplinkCount?: long(name='UplinkCount'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGatewayTransferFlowStatsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGatewayTransferFlowStatsResponseBody(name='body'),
}

async function listGatewayTransferFlowStatsWithOptions(request: ListGatewayTransferFlowStatsRequest, runtime: Util.RuntimeOptions): ListGatewayTransferFlowStatsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.timeIntervalUnit)) {
    query['TimeIntervalUnit'] = request.timeIntervalUnit;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGatewayTransferFlowStats',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGatewayTransferFlowStats(request: ListGatewayTransferFlowStatsRequest): ListGatewayTransferFlowStatsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGatewayTransferFlowStatsWithOptions(request, runtime);
}

model ListGatewayTransferPacketsRequest {
  ascending?: boolean(name='Ascending'),
  beginMillis?: long(name='BeginMillis'),
  category?: string(name='Category'),
  devEui?: string(name='DevEui'),
  endMillis?: long(name='EndMillis'),
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  sortingField?: string(name='SortingField'),
}

model ListGatewayTransferPacketsResponseBody = {
  data?: {
    list?: [ 
      {
        base64EncodedMacPayload?: string(name='Base64EncodedMacPayload'),
        classMode?: string(name='ClassMode'),
        datr?: string(name='Datr'),
        devAddr?: string(name='DevAddr'),
        devEui?: string(name='DevEui'),
        FPort?: int32(name='FPort'),
        freq?: string(name='Freq'),
        gwEui?: string(name='GwEui'),
        hasData?: boolean(name='HasData'),
        hasMacCommand?: boolean(name='HasMacCommand'),
        logMillis?: string(name='LogMillis'),
        lsnr?: float(name='Lsnr'),
        macCommandCIDs?: [  map[string]any ](name='MacCommandCIDs'),
        macPayloadSize?: long(name='MacPayloadSize'),
        messageType?: string(name='MessageType'),
        nodeOwnerAliyunId?: string(name='NodeOwnerAliyunId'),
        processEvent?: string(name='ProcessEvent'),
        rssi?: int32(name='Rssi'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGatewayTransferPacketsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGatewayTransferPacketsResponseBody(name='body'),
}

async function listGatewayTransferPacketsWithOptions(request: ListGatewayTransferPacketsRequest, runtime: Util.RuntimeOptions): ListGatewayTransferPacketsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGatewayTransferPackets',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGatewayTransferPackets(request: ListGatewayTransferPacketsRequest): ListGatewayTransferPacketsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGatewayTransferPacketsWithOptions(request, runtime);
}

model ListGatewayTupleOrdersRequest {
  ascending?: boolean(name='Ascending'),
  limit?: long(name='Limit'),
  offset?: long(name='Offset'),
  sortingField?: string(name='SortingField'),
  state?: [ string ](name='State'),
}

model ListGatewayTupleOrdersResponseBody = {
  data?: {
    list?: [ 
      {
        acceptedMillis?: long(name='AcceptedMillis'),
        createdMillis?: long(name='CreatedMillis'),
        orderId?: string(name='OrderId'),
        orderState?: string(name='OrderState'),
        requiredCount?: long(name='RequiredCount'),
        tupleType?: string(name='TupleType'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGatewayTupleOrdersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGatewayTupleOrdersResponseBody(name='body'),
}

async function listGatewayTupleOrdersWithOptions(request: ListGatewayTupleOrdersRequest, runtime: Util.RuntimeOptions): ListGatewayTupleOrdersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGatewayTupleOrders',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGatewayTupleOrders(request: ListGatewayTupleOrdersRequest): ListGatewayTupleOrdersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGatewayTupleOrdersWithOptions(request, runtime);
}

model ListGatewaysRequest {
  ascending?: boolean(name='Ascending'),
  freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
  fuzzyCity?: string(name='FuzzyCity'),
  fuzzyGwEui?: string(name='FuzzyGwEui'),
  fuzzyName?: string(name='FuzzyName'),
  iotInstanceId?: string(name='IotInstanceId'),
  isEnabled?: boolean(name='IsEnabled'),
  limit?: long(name='Limit'),
  offset?: long(name='Offset'),
  onlineState?: string(name='OnlineState'),
  sortingField?: string(name='SortingField'),
}

model ListGatewaysResponseBody = {
  data?: {
    list?: [ 
      {
        address?: string(name='Address'),
        addressCode?: long(name='AddressCode'),
        authTypes?: string(name='AuthTypes'),
        chargeStatus?: string(name='ChargeStatus'),
        city?: string(name='City'),
        classBSupported?: boolean(name='ClassBSupported'),
        classBWorking?: boolean(name='ClassBWorking'),
        communicationMode?: string(name='CommunicationMode'),
        description?: string(name='Description'),
        district?: string(name='District'),
        embeddedNsId?: string(name='EmbeddedNsId'),
        enabled?: boolean(name='Enabled'),
        freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
        gisCoordinateSystem?: string(name='GisCoordinateSystem'),
        gwEui?: string(name='GwEui'),
        latitude?: float(name='Latitude'),
        longitude?: float(name='Longitude'),
        name?: string(name='Name'),
        onlineState?: string(name='OnlineState'),
        onlineStateChangedMillis?: long(name='OnlineStateChangedMillis'),
        timeCorrectable?: boolean(name='TimeCorrectable'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGatewaysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGatewaysResponseBody(name='body'),
}

async function listGatewaysWithOptions(request: ListGatewaysRequest, runtime: Util.RuntimeOptions): ListGatewaysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.freqBandPlanGroupId)) {
    query['FreqBandPlanGroupId'] = request.freqBandPlanGroupId;
  }
  if (!Util.isUnset(request.fuzzyCity)) {
    query['FuzzyCity'] = request.fuzzyCity;
  }
  if (!Util.isUnset(request.fuzzyGwEui)) {
    query['FuzzyGwEui'] = request.fuzzyGwEui;
  }
  if (!Util.isUnset(request.fuzzyName)) {
    query['FuzzyName'] = request.fuzzyName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.isEnabled)) {
    query['IsEnabled'] = request.isEnabled;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.onlineState)) {
    query['OnlineState'] = request.onlineState;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGateways',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGateways(request: ListGatewaysRequest): ListGatewaysResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGatewaysWithOptions(request, runtime);
}

model ListGatewaysGisInfoRequest {
  iotInstanceId?: string(name='IotInstanceId'),
}

model ListGatewaysGisInfoResponseBody = {
  data?: [ 
    {
      authTypes?: string(name='AuthTypes'),
      chargeStatus?: string(name='ChargeStatus'),
      enabled?: boolean(name='Enabled'),
      freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
      gisCoordinateSystem?: string(name='GisCoordinateSystem'),
      gisSourceType?: string(name='GisSourceType'),
      gwEui?: string(name='GwEui'),
      latitude?: float(name='Latitude'),
      longitude?: float(name='Longitude'),
      name?: string(name='Name'),
      onlineState?: string(name='OnlineState'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGatewaysGisInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGatewaysGisInfoResponseBody(name='body'),
}

async function listGatewaysGisInfoWithOptions(request: ListGatewaysGisInfoRequest, runtime: Util.RuntimeOptions): ListGatewaysGisInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGatewaysGisInfo',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGatewaysGisInfo(request: ListGatewaysGisInfoRequest): ListGatewaysGisInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGatewaysGisInfoWithOptions(request, runtime);
}

model ListNodeGroupTransferFlowStatsRequest {
  beginMillis?: long(name='BeginMillis'),
  endMillis?: long(name='EndMillis'),
  iotInstanceId?: string(name='IotInstanceId'),
  nodeGroupId?: string(name='NodeGroupId'),
  timeIntervalUnit?: string(name='TimeIntervalUnit'),
}

model ListNodeGroupTransferFlowStatsResponseBody = {
  data?: [ 
    {
      downlinkCount?: long(name='DownlinkCount'),
      statMillis?: long(name='StatMillis'),
      uplinkCount?: long(name='UplinkCount'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNodeGroupTransferFlowStatsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodeGroupTransferFlowStatsResponseBody(name='body'),
}

async function listNodeGroupTransferFlowStatsWithOptions(request: ListNodeGroupTransferFlowStatsRequest, runtime: Util.RuntimeOptions): ListNodeGroupTransferFlowStatsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  if (!Util.isUnset(request.timeIntervalUnit)) {
    query['TimeIntervalUnit'] = request.timeIntervalUnit;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodeGroupTransferFlowStats',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodeGroupTransferFlowStats(request: ListNodeGroupTransferFlowStatsRequest): ListNodeGroupTransferFlowStatsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodeGroupTransferFlowStatsWithOptions(request, runtime);
}

model ListNodeGroupTransferPacketsRequest {
  ascending?: boolean(name='Ascending'),
  beginMillis?: long(name='BeginMillis'),
  category?: string(name='Category'),
  devEui?: string(name='DevEui'),
  endMillis?: long(name='EndMillis'),
  iotInstanceId?: string(name='IotInstanceId'),
  nodeGroupId?: string(name='NodeGroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  sortingField?: string(name='SortingField'),
}

model ListNodeGroupTransferPacketsResponseBody = {
  data?: {
    list?: [ 
      {
        base64EncodedMacPayload?: string(name='Base64EncodedMacPayload'),
        classMode?: string(name='ClassMode'),
        datr?: string(name='Datr'),
        devAddr?: string(name='DevAddr'),
        devEui?: string(name='DevEui'),
        FPort?: int32(name='FPort'),
        fcntDown?: long(name='FcntDown'),
        fcntUp?: long(name='FcntUp'),
        freq?: float(name='Freq'),
        freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
        gwEui?: string(name='GwEui'),
        gwOwnerAliyunId?: string(name='GwOwnerAliyunId'),
        hasData?: boolean(name='HasData'),
        hasMacCommand?: boolean(name='HasMacCommand'),
        logMillis?: long(name='LogMillis'),
        lsnr?: float(name='Lsnr'),
        macCommandCIDs?: string(name='MacCommandCIDs'),
        macPayloadSize?: long(name='MacPayloadSize'),
        messageType?: string(name='MessageType'),
        processEvent?: string(name='ProcessEvent'),
        rssi?: int32(name='Rssi'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNodeGroupTransferPacketsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodeGroupTransferPacketsResponseBody(name='body'),
}

async function listNodeGroupTransferPacketsWithOptions(request: ListNodeGroupTransferPacketsRequest, runtime: Util.RuntimeOptions): ListNodeGroupTransferPacketsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodeGroupTransferPackets',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodeGroupTransferPackets(request: ListNodeGroupTransferPacketsRequest): ListNodeGroupTransferPacketsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodeGroupTransferPacketsWithOptions(request, runtime);
}

model ListNodeGroupsRequest {
  ascending?: boolean(name='Ascending'),
  fuzzyDevEui?: string(name='FuzzyDevEui'),
  fuzzyJoinEui?: string(name='FuzzyJoinEui'),
  fuzzyName?: string(name='FuzzyName'),
  iotInstanceId?: string(name='IotInstanceId'),
  limit?: long(name='Limit'),
  offset?: long(name='Offset'),
  sortingField?: string(name='SortingField'),
}

model ListNodeGroupsResponseBody = {
  data?: {
    list?: [ 
      {
        classMode?: string(name='ClassMode'),
        createMillis?: long(name='CreateMillis'),
        dataDispatchConfig?: {
          destination?: string(name='Destination'),
          iotProduct?: {
            debugSwitch?: boolean(name='DebugSwitch'),
            productKey?: string(name='ProductKey'),
            productName?: string(name='ProductName'),
            productType?: string(name='ProductType'),
          }(name='IotProduct'),
          onsTopics?: {
            downlinkRegionName?: string(name='DownlinkRegionName'),
            downlinkTopic?: string(name='DownlinkTopic'),
            uplinkRegionName?: string(name='UplinkRegionName'),
            uplinkTopic?: string(name='UplinkTopic'),
          }(name='OnsTopics'),
        }(name='DataDispatchConfig'),
        dataDispatchEnabled?: boolean(name='DataDispatchEnabled'),
        freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
        joinEui?: string(name='JoinEui'),
        joinPermissionEnabled?: boolean(name='JoinPermissionEnabled'),
        joinPermissionId?: string(name='JoinPermissionId'),
        joinPermissionName?: string(name='JoinPermissionName'),
        joinPermissionOwnerAliyunId?: string(name='JoinPermissionOwnerAliyunId'),
        joinPermissionType?: string(name='JoinPermissionType'),
        locks?: [ 
          {
            createMillis?: long(name='CreateMillis'),
            enabled?: boolean(name='Enabled'),
            lockId?: string(name='LockId'),
            lockType?: string(name='LockType'),
          }
        ](name='Locks'),
        nodeGroupId?: string(name='NodeGroupId'),
        nodeGroupName?: string(name='NodeGroupName'),
        nodesCnt?: long(name='NodesCnt'),
        rxDailySum?: long(name='RxDailySum'),
        rxMonthSum?: long(name='RxMonthSum'),
        txDailySum?: long(name='TxDailySum'),
        txMonthSum?: long(name='TxMonthSum'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNodeGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodeGroupsResponseBody(name='body'),
}

async function listNodeGroupsWithOptions(request: ListNodeGroupsRequest, runtime: Util.RuntimeOptions): ListNodeGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.fuzzyDevEui)) {
    query['FuzzyDevEui'] = request.fuzzyDevEui;
  }
  if (!Util.isUnset(request.fuzzyJoinEui)) {
    query['FuzzyJoinEui'] = request.fuzzyJoinEui;
  }
  if (!Util.isUnset(request.fuzzyName)) {
    query['FuzzyName'] = request.fuzzyName;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodeGroups',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodeGroups(request: ListNodeGroupsRequest): ListNodeGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodeGroupsWithOptions(request, runtime);
}

model ListNodeTransferPacketPathsRequest {
  base64EncodedMacPayload?: string(name='Base64EncodedMacPayload'),
  devEui?: string(name='DevEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  logMillis?: long(name='LogMillis'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListNodeTransferPacketPathsResponseBody = {
  data?: {
    list?: [ 
      {
        bestPath?: boolean(name='BestPath'),
        devEui?: string(name='DevEui'),
        gwEui?: string(name='GwEui'),
        lsnr?: float(name='Lsnr'),
        rssi?: int32(name='Rssi'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNodeTransferPacketPathsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodeTransferPacketPathsResponseBody(name='body'),
}

async function listNodeTransferPacketPathsWithOptions(request: ListNodeTransferPacketPathsRequest, runtime: Util.RuntimeOptions): ListNodeTransferPacketPathsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.base64EncodedMacPayload)) {
    query['Base64EncodedMacPayload'] = request.base64EncodedMacPayload;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.logMillis)) {
    query['LogMillis'] = request.logMillis;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodeTransferPacketPaths',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodeTransferPacketPaths(request: ListNodeTransferPacketPathsRequest): ListNodeTransferPacketPathsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodeTransferPacketPathsWithOptions(request, runtime);
}

model ListNodeTransferPacketsRequest {
  ascending?: boolean(name='Ascending'),
  beginMillis?: long(name='BeginMillis'),
  category?: string(name='Category'),
  devEui?: string(name='DevEui'),
  endMillis?: long(name='EndMillis'),
  gwEui?: string(name='GwEui'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  sortingField?: string(name='SortingField'),
}

model ListNodeTransferPacketsResponseBody = {
  data?: {
    list?: [ 
      {
        classMode?: string(name='ClassMode'),
        datr?: string(name='Datr'),
        devEui?: string(name='DevEui'),
        freq?: float(name='Freq'),
        gwEui?: string(name='GwEui'),
        logMillis?: long(name='LogMillis'),
        rssi?: int32(name='Rssi'),
        snr?: float(name='Snr'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNodeTransferPacketsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodeTransferPacketsResponseBody(name='body'),
}

async function listNodeTransferPacketsWithOptions(request: ListNodeTransferPacketsRequest, runtime: Util.RuntimeOptions): ListNodeTransferPacketsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodeTransferPackets',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodeTransferPackets(request: ListNodeTransferPacketsRequest): ListNodeTransferPacketsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodeTransferPacketsWithOptions(request, runtime);
}

model ListNodeTupleOrdersRequest {
  ascending?: boolean(name='Ascending'),
  isKpm?: boolean(name='IsKpm'),
  limit?: long(name='Limit'),
  offset?: long(name='Offset'),
  sortingField?: string(name='SortingField'),
  state?: [ string ](name='State'),
}

model ListNodeTupleOrdersResponseBody = {
  data?: {
    list?: [ 
      {
        acceptedMillis?: long(name='AcceptedMillis'),
        createdMillis?: long(name='CreatedMillis'),
        failedCount?: long(name='FailedCount'),
        isKpm?: boolean(name='IsKpm'),
        loraVersion?: string(name='LoraVersion'),
        orderId?: string(name='OrderId'),
        orderState?: string(name='OrderState'),
        requiredCount?: long(name='RequiredCount'),
        successCount?: long(name='SuccessCount'),
        tupleType?: string(name='TupleType'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNodeTupleOrdersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodeTupleOrdersResponseBody(name='body'),
}

async function listNodeTupleOrdersWithOptions(request: ListNodeTupleOrdersRequest, runtime: Util.RuntimeOptions): ListNodeTupleOrdersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.isKpm)) {
    query['IsKpm'] = request.isKpm;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodeTupleOrders',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodeTupleOrders(request: ListNodeTupleOrdersRequest): ListNodeTupleOrdersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodeTupleOrdersWithOptions(request, runtime);
}

model ListNodesByNodeGroupIdRequest {
  ascending?: boolean(name='Ascending'),
  fuzzyDevEui?: string(name='FuzzyDevEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  limit?: long(name='Limit'),
  nodeGroupId?: string(name='NodeGroupId'),
  offset?: long(name='Offset'),
  sortingField?: string(name='SortingField'),
}

model ListNodesByNodeGroupIdResponseBody = {
  data?: {
    list?: [ 
      {
        appkey?: string(name='Appkey'),
        authTypes?: string(name='AuthTypes'),
        boundMillis?: long(name='BoundMillis'),
        classMode?: string(name='ClassMode'),
        devAddr?: string(name='DevAddr'),
        devEui?: string(name='DevEui'),
        joinEui?: string(name='JoinEui'),
        lastJoinMillis?: long(name='LastJoinMillis'),
        multicastGroupId?: string(name='MulticastGroupId'),
        nodeType?: string(name='NodeType'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNodesByNodeGroupIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodesByNodeGroupIdResponseBody(name='body'),
}

async function listNodesByNodeGroupIdWithOptions(request: ListNodesByNodeGroupIdRequest, runtime: Util.RuntimeOptions): ListNodesByNodeGroupIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.fuzzyDevEui)) {
    query['FuzzyDevEui'] = request.fuzzyDevEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodesByNodeGroupId',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodesByNodeGroupId(request: ListNodesByNodeGroupIdRequest): ListNodesByNodeGroupIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodesByNodeGroupIdWithOptions(request, runtime);
}

model ListNodesByOwnedJoinPermissionIdRequest {
  ascending?: boolean(name='Ascending'),
  fuzzyDevEui?: string(name='FuzzyDevEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  joinPermissionId?: string(name='JoinPermissionId'),
  limit?: long(name='Limit'),
  offset?: long(name='Offset'),
  sortingField?: string(name='SortingField'),
}

model ListNodesByOwnedJoinPermissionIdResponseBody = {
  data?: {
    list?: [ 
      {
        boundMillis?: long(name='BoundMillis'),
        classMode?: string(name='ClassMode'),
        devAddr?: string(name='DevAddr'),
        devEui?: string(name='DevEui'),
        lastJoinMillis?: long(name='LastJoinMillis'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNodesByOwnedJoinPermissionIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodesByOwnedJoinPermissionIdResponseBody(name='body'),
}

async function listNodesByOwnedJoinPermissionIdWithOptions(request: ListNodesByOwnedJoinPermissionIdRequest, runtime: Util.RuntimeOptions): ListNodesByOwnedJoinPermissionIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.fuzzyDevEui)) {
    query['FuzzyDevEui'] = request.fuzzyDevEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodesByOwnedJoinPermissionId',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodesByOwnedJoinPermissionId(request: ListNodesByOwnedJoinPermissionIdRequest): ListNodesByOwnedJoinPermissionIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodesByOwnedJoinPermissionIdWithOptions(request, runtime);
}

model ListNotificationsRequest {
  ascending?: boolean(name='Ascending'),
  beginMillis?: long(name='BeginMillis'),
  category?: [ string ](name='Category'),
  endMillis?: long(name='EndMillis'),
  handleState?: string(name='HandleState'),
  limit?: long(name='Limit'),
  offset?: long(name='Offset'),
  sortingField?: string(name='SortingField'),
}

model ListNotificationsResponseBody = {
  data?: {
    list?: [ 
      {
        category?: string(name='Category'),
        gatewayDataflowLimit?: {
          alarmDetail?: string(name='AlarmDetail'),
          dataflowLimitMillis?: long(name='DataflowLimitMillis'),
          gwEui?: string(name='GwEui'),
        }(name='GatewayDataflowLimit'),
        gatewayOfflineInfo?: {
          gwEui?: string(name='GwEui'),
          offlineMillis?: long(name='OfflineMillis'),
        }(name='GatewayOfflineInfo'),
        handleState?: string(name='HandleState'),
        handledMillis?: long(name='HandledMillis'),
        joinPermissionAuthInfo?: {
          acceptedMillis?: long(name='AcceptedMillis'),
          applyingMillis?: long(name='ApplyingMillis'),
          canceledMillis?: long(name='CanceledMillis'),
          joinEui?: string(name='JoinEui'),
          joinPermissionId?: string(name='JoinPermissionId'),
          joinPermissionName?: string(name='JoinPermissionName'),
          orderId?: string(name='OrderId'),
          orderState?: string(name='OrderState'),
          ownerAliyunId?: string(name='OwnerAliyunId'),
          rejectedMillis?: long(name='RejectedMillis'),
          renterAliyunId?: string(name='RenterAliyunId'),
        }(name='JoinPermissionAuthInfo'),
        noticeMillis?: long(name='NoticeMillis'),
        notificationId?: string(name='NotificationId'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListNotificationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNotificationsResponseBody(name='body'),
}

async function listNotificationsWithOptions(request: ListNotificationsRequest, runtime: Util.RuntimeOptions): ListNotificationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.beginMillis)) {
    query['BeginMillis'] = request.beginMillis;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.endMillis)) {
    query['EndMillis'] = request.endMillis;
  }
  if (!Util.isUnset(request.handleState)) {
    query['HandleState'] = request.handleState;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNotifications',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNotifications(request: ListNotificationsRequest): ListNotificationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNotificationsWithOptions(request, runtime);
}

model ListOwnedJoinPermissionsRequest {
  ascending?: boolean(name='Ascending'),
  enabled?: boolean(name='Enabled'),
  fuzzyJoinEui?: string(name='FuzzyJoinEui'),
  fuzzyJoinPermissionName?: string(name='FuzzyJoinPermissionName'),
  fuzzyRenterAliyunId?: string(name='FuzzyRenterAliyunId'),
  iotInstanceId?: string(name='IotInstanceId'),
  limit?: long(name='Limit'),
  offset?: long(name='Offset'),
  sortingField?: string(name='SortingField'),
}

model ListOwnedJoinPermissionsResponseBody = {
  data?: {
    list?: [ 
      {
        authState?: string(name='AuthState'),
        classMode?: string(name='ClassMode'),
        dataRate?: long(name='DataRate'),
        enabled?: boolean(name='Enabled'),
        freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
        joinEui?: string(name='JoinEui'),
        joinPermissionId?: string(name='JoinPermissionId'),
        joinPermissionName?: string(name='JoinPermissionName'),
        renterAliyunId?: string(name='RenterAliyunId'),
        rxDelay?: long(name='RxDelay'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListOwnedJoinPermissionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListOwnedJoinPermissionsResponseBody(name='body'),
}

async function listOwnedJoinPermissionsWithOptions(request: ListOwnedJoinPermissionsRequest, runtime: Util.RuntimeOptions): ListOwnedJoinPermissionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.fuzzyJoinEui)) {
    query['FuzzyJoinEui'] = request.fuzzyJoinEui;
  }
  if (!Util.isUnset(request.fuzzyJoinPermissionName)) {
    query['FuzzyJoinPermissionName'] = request.fuzzyJoinPermissionName;
  }
  if (!Util.isUnset(request.fuzzyRenterAliyunId)) {
    query['FuzzyRenterAliyunId'] = request.fuzzyRenterAliyunId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOwnedJoinPermissions',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOwnedJoinPermissions(request: ListOwnedJoinPermissionsRequest): ListOwnedJoinPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOwnedJoinPermissionsWithOptions(request, runtime);
}

model ListRentedJoinPermissionsRequest {
  ascending?: boolean(name='Ascending'),
  boundNodeGroup?: boolean(name='BoundNodeGroup'),
  enabled?: boolean(name='Enabled'),
  fuzzyJoinEui?: string(name='FuzzyJoinEui'),
  fuzzyJoinPermissionName?: string(name='FuzzyJoinPermissionName'),
  fuzzyOwnerAliyunId?: string(name='FuzzyOwnerAliyunId'),
  iotInstanceId?: string(name='IotInstanceId'),
  limit?: long(name='Limit'),
  offset?: long(name='Offset'),
  sortingField?: string(name='SortingField'),
  type?: string(name='Type'),
}

model ListRentedJoinPermissionsResponseBody = {
  data?: {
    list?: [ 
      {
        boundNodeGroup?: boolean(name='BoundNodeGroup'),
        boundNodeGroupId?: string(name='BoundNodeGroupId'),
        boundNodeGroupName?: string(name='BoundNodeGroupName'),
        classMode?: string(name='ClassMode'),
        dataDispatchConfig?: {
          destination?: string(name='Destination'),
          iotProduct?: {
            debugSwitch?: boolean(name='DebugSwitch'),
            productKey?: string(name='ProductKey'),
            productName?: string(name='ProductName'),
            productType?: string(name='ProductType'),
          }(name='IotProduct'),
          onsTopics?: {
            downlinkRegionName?: string(name='DownlinkRegionName'),
            downlinkTopic?: string(name='DownlinkTopic'),
            uplinkRegionName?: string(name='UplinkRegionName'),
            uplinkTopic?: string(name='UplinkTopic'),
          }(name='OnsTopics'),
        }(name='DataDispatchConfig'),
        dataRate?: string(name='DataRate'),
        enabled?: boolean(name='Enabled'),
        freqBandPlanGroupId?: string(name='FreqBandPlanGroupId'),
        joinEui?: string(name='JoinEui'),
        joinPermissionId?: string(name='JoinPermissionId'),
        joinPermissionName?: string(name='JoinPermissionName'),
        ownerAliyunId?: string(name='OwnerAliyunId'),
        rxDelay?: string(name='RxDelay'),
        type?: string(name='Type'),
      }
    ](name='List'),
    totalCount?: long(name='TotalCount'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListRentedJoinPermissionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListRentedJoinPermissionsResponseBody(name='body'),
}

async function listRentedJoinPermissionsWithOptions(request: ListRentedJoinPermissionsRequest, runtime: Util.RuntimeOptions): ListRentedJoinPermissionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.boundNodeGroup)) {
    query['BoundNodeGroup'] = request.boundNodeGroup;
  }
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.fuzzyJoinEui)) {
    query['FuzzyJoinEui'] = request.fuzzyJoinEui;
  }
  if (!Util.isUnset(request.fuzzyJoinPermissionName)) {
    query['FuzzyJoinPermissionName'] = request.fuzzyJoinPermissionName;
  }
  if (!Util.isUnset(request.fuzzyOwnerAliyunId)) {
    query['FuzzyOwnerAliyunId'] = request.fuzzyOwnerAliyunId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.sortingField)) {
    query['SortingField'] = request.sortingField;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRentedJoinPermissions',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRentedJoinPermissions(request: ListRentedJoinPermissionsRequest): ListRentedJoinPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRentedJoinPermissionsWithOptions(request, runtime);
}

model RejectJoinPermissionAuthOrderRequest {
  orderId?: string(name='OrderId'),
}

model RejectJoinPermissionAuthOrderResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RejectJoinPermissionAuthOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RejectJoinPermissionAuthOrderResponseBody(name='body'),
}

async function rejectJoinPermissionAuthOrderWithOptions(request: RejectJoinPermissionAuthOrderRequest, runtime: Util.RuntimeOptions): RejectJoinPermissionAuthOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RejectJoinPermissionAuthOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function rejectJoinPermissionAuthOrder(request: RejectJoinPermissionAuthOrderRequest): RejectJoinPermissionAuthOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return rejectJoinPermissionAuthOrderWithOptions(request, runtime);
}

model RemoveNodeFromGroupRequest {
  devEui?: string(name='DevEui'),
  nodeGroupId?: string(name='NodeGroupId'),
}

model RemoveNodeFromGroupResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RemoveNodeFromGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveNodeFromGroupResponseBody(name='body'),
}

async function removeNodeFromGroupWithOptions(request: RemoveNodeFromGroupRequest, runtime: Util.RuntimeOptions): RemoveNodeFromGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveNodeFromGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeNodeFromGroup(request: RemoveNodeFromGroupRequest): RemoveNodeFromGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeNodeFromGroupWithOptions(request, runtime);
}

model ReturnJoinPermissionRequest {
  joinPermissionId?: string(name='JoinPermissionId'),
  joinPermissionType?: string(name='JoinPermissionType'),
}

model ReturnJoinPermissionResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReturnJoinPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReturnJoinPermissionResponseBody(name='body'),
}

async function returnJoinPermissionWithOptions(request: ReturnJoinPermissionRequest, runtime: Util.RuntimeOptions): ReturnJoinPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  if (!Util.isUnset(request.joinPermissionType)) {
    query['JoinPermissionType'] = request.joinPermissionType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReturnJoinPermission',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function returnJoinPermission(request: ReturnJoinPermissionRequest): ReturnJoinPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return returnJoinPermissionWithOptions(request, runtime);
}

model SendUnicastCommandRequest {
  cleanUp?: boolean(name='CleanUp'),
  confirmed?: boolean(name='Confirmed'),
  content?: string(name='Content'),
  devEui?: string(name='DevEui'),
  FPort?: int32(name='FPort'),
  iotInstanceId?: string(name='IotInstanceId'),
  maxRetries?: int32(name='MaxRetries'),
}

model SendUnicastCommandResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SendUnicastCommandResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SendUnicastCommandResponseBody(name='body'),
}

async function sendUnicastCommandWithOptions(request: SendUnicastCommandRequest, runtime: Util.RuntimeOptions): SendUnicastCommandResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cleanUp)) {
    query['CleanUp'] = request.cleanUp;
  }
  if (!Util.isUnset(request.confirmed)) {
    query['Confirmed'] = request.confirmed;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.devEui)) {
    query['DevEui'] = request.devEui;
  }
  if (!Util.isUnset(request.FPort)) {
    query['FPort'] = request.FPort;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.maxRetries)) {
    query['MaxRetries'] = request.maxRetries;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendUnicastCommand',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendUnicastCommand(request: SendUnicastCommandRequest): SendUnicastCommandResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendUnicastCommandWithOptions(request, runtime);
}

model SubmitGatewayTupleOrderRequest {
  requiredCount?: long(name='RequiredCount'),
  tupleType?: string(name='TupleType'),
}

model SubmitGatewayTupleOrderResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SubmitGatewayTupleOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitGatewayTupleOrderResponseBody(name='body'),
}

async function submitGatewayTupleOrderWithOptions(request: SubmitGatewayTupleOrderRequest, runtime: Util.RuntimeOptions): SubmitGatewayTupleOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.requiredCount)) {
    query['RequiredCount'] = request.requiredCount;
  }
  if (!Util.isUnset(request.tupleType)) {
    query['TupleType'] = request.tupleType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitGatewayTupleOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitGatewayTupleOrder(request: SubmitGatewayTupleOrderRequest): SubmitGatewayTupleOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitGatewayTupleOrderWithOptions(request, runtime);
}

model SubmitJoinPermissionAuthOrderRequest {
  joinPermissionId?: string(name='JoinPermissionId'),
  renterAliyunId?: string(name='RenterAliyunId'),
}

model SubmitJoinPermissionAuthOrderResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SubmitJoinPermissionAuthOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitJoinPermissionAuthOrderResponseBody(name='body'),
}

async function submitJoinPermissionAuthOrderWithOptions(request: SubmitJoinPermissionAuthOrderRequest, runtime: Util.RuntimeOptions): SubmitJoinPermissionAuthOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  if (!Util.isUnset(request.renterAliyunId)) {
    query['RenterAliyunId'] = request.renterAliyunId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitJoinPermissionAuthOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitJoinPermissionAuthOrder(request: SubmitJoinPermissionAuthOrderRequest): SubmitJoinPermissionAuthOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitJoinPermissionAuthOrderWithOptions(request, runtime);
}

model SubmitNodeTupleOrderRequest {
  loraVersion?: string(name='LoraVersion'),
  requiredCount?: long(name='RequiredCount'),
  tupleType?: string(name='TupleType'),
}

model SubmitNodeTupleOrderResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SubmitNodeTupleOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitNodeTupleOrderResponseBody(name='body'),
}

async function submitNodeTupleOrderWithOptions(request: SubmitNodeTupleOrderRequest, runtime: Util.RuntimeOptions): SubmitNodeTupleOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.loraVersion)) {
    query['LoraVersion'] = request.loraVersion;
  }
  if (!Util.isUnset(request.requiredCount)) {
    query['RequiredCount'] = request.requiredCount;
  }
  if (!Util.isUnset(request.tupleType)) {
    query['TupleType'] = request.tupleType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitNodeTupleOrder',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitNodeTupleOrder(request: SubmitNodeTupleOrderRequest): SubmitNodeTupleOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitNodeTupleOrderWithOptions(request, runtime);
}

model UnbindJoinPermissionFromNodeGroupRequest {
  joinPermissionId?: string(name='JoinPermissionId'),
  nodeGroupId?: string(name='NodeGroupId'),
}

model UnbindJoinPermissionFromNodeGroupResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UnbindJoinPermissionFromNodeGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UnbindJoinPermissionFromNodeGroupResponseBody(name='body'),
}

async function unbindJoinPermissionFromNodeGroupWithOptions(request: UnbindJoinPermissionFromNodeGroupRequest, runtime: Util.RuntimeOptions): UnbindJoinPermissionFromNodeGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindJoinPermissionFromNodeGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unbindJoinPermissionFromNodeGroup(request: UnbindJoinPermissionFromNodeGroupRequest): UnbindJoinPermissionFromNodeGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindJoinPermissionFromNodeGroupWithOptions(request, runtime);
}

model UpdateDataDispatchConfigRequest {
  dataDispatchDestination?: string(name='DataDispatchDestination'),
  debugSwitch?: boolean(name='DebugSwitch'),
  nodeGroupId?: string(name='NodeGroupId'),
  productKey?: string(name='ProductKey'),
  productName?: string(name='ProductName'),
  productType?: string(name='ProductType'),
  uplinkRegionName?: string(name='UplinkRegionName'),
  uplinkTopic?: string(name='UplinkTopic'),
}

model UpdateDataDispatchConfigResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateDataDispatchConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateDataDispatchConfigResponseBody(name='body'),
}

async function updateDataDispatchConfigWithOptions(request: UpdateDataDispatchConfigRequest, runtime: Util.RuntimeOptions): UpdateDataDispatchConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dataDispatchDestination)) {
    query['DataDispatchDestination'] = request.dataDispatchDestination;
  }
  if (!Util.isUnset(request.debugSwitch)) {
    query['DebugSwitch'] = request.debugSwitch;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.productName)) {
    query['ProductName'] = request.productName;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.uplinkRegionName)) {
    query['UplinkRegionName'] = request.uplinkRegionName;
  }
  if (!Util.isUnset(request.uplinkTopic)) {
    query['UplinkTopic'] = request.uplinkTopic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDataDispatchConfig',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDataDispatchConfig(request: UpdateDataDispatchConfigRequest): UpdateDataDispatchConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDataDispatchConfigWithOptions(request, runtime);
}

model UpdateDataDispatchEnablingStateRequest {
  dataDispatchEnabled?: boolean(name='DataDispatchEnabled'),
  nodeGroupId?: string(name='NodeGroupId'),
}

model UpdateDataDispatchEnablingStateResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateDataDispatchEnablingStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateDataDispatchEnablingStateResponseBody(name='body'),
}

async function updateDataDispatchEnablingStateWithOptions(request: UpdateDataDispatchEnablingStateRequest, runtime: Util.RuntimeOptions): UpdateDataDispatchEnablingStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dataDispatchEnabled)) {
    query['DataDispatchEnabled'] = request.dataDispatchEnabled;
  }
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDataDispatchEnablingState',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDataDispatchEnablingState(request: UpdateDataDispatchEnablingStateRequest): UpdateDataDispatchEnablingStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDataDispatchEnablingStateWithOptions(request, runtime);
}

model UpdateGatewayRequest {
  address?: string(name='Address'),
  addressCode?: long(name='AddressCode'),
  city?: string(name='City'),
  communicationMode?: string(name='CommunicationMode'),
  description?: string(name='Description'),
  district?: string(name='District'),
  freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
  gisCoordinateSystem?: string(name='GisCoordinateSystem'),
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
  latitude?: float(name='Latitude'),
  longitude?: float(name='Longitude'),
  name?: string(name='Name'),
}

model UpdateGatewayResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateGatewayResponseBody(name='body'),
}

async function updateGatewayWithOptions(request: UpdateGatewayRequest, runtime: Util.RuntimeOptions): UpdateGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.addressCode)) {
    query['AddressCode'] = request.addressCode;
  }
  if (!Util.isUnset(request.city)) {
    query['City'] = request.city;
  }
  if (!Util.isUnset(request.communicationMode)) {
    query['CommunicationMode'] = request.communicationMode;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.district)) {
    query['District'] = request.district;
  }
  if (!Util.isUnset(request.freqBandPlanGroupId)) {
    query['FreqBandPlanGroupId'] = request.freqBandPlanGroupId;
  }
  if (!Util.isUnset(request.gisCoordinateSystem)) {
    query['GisCoordinateSystem'] = request.gisCoordinateSystem;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.latitude)) {
    query['Latitude'] = request.latitude;
  }
  if (!Util.isUnset(request.longitude)) {
    query['Longitude'] = request.longitude;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGateway',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGateway(request: UpdateGatewayRequest): UpdateGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGatewayWithOptions(request, runtime);
}

model UpdateGatewayEnablingStateRequest {
  enabled?: boolean(name='Enabled'),
  gwEui?: string(name='GwEui'),
  iotInstanceId?: string(name='IotInstanceId'),
}

model UpdateGatewayEnablingStateResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateGatewayEnablingStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateGatewayEnablingStateResponseBody(name='body'),
}

async function updateGatewayEnablingStateWithOptions(request: UpdateGatewayEnablingStateRequest, runtime: Util.RuntimeOptions): UpdateGatewayEnablingStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.gwEui)) {
    query['GwEui'] = request.gwEui;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGatewayEnablingState',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGatewayEnablingState(request: UpdateGatewayEnablingStateRequest): UpdateGatewayEnablingStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGatewayEnablingStateWithOptions(request, runtime);
}

model UpdateNodeGroupRequest {
  nodeGroupId?: string(name='NodeGroupId'),
  nodeGroupName?: string(name='NodeGroupName'),
}

model UpdateNodeGroupResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateNodeGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateNodeGroupResponseBody(name='body'),
}

async function updateNodeGroupWithOptions(request: UpdateNodeGroupRequest, runtime: Util.RuntimeOptions): UpdateNodeGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nodeGroupId)) {
    query['NodeGroupId'] = request.nodeGroupId;
  }
  if (!Util.isUnset(request.nodeGroupName)) {
    query['NodeGroupName'] = request.nodeGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateNodeGroup',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateNodeGroup(request: UpdateNodeGroupRequest): UpdateNodeGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateNodeGroupWithOptions(request, runtime);
}

model UpdateNotificationsHandleStateRequest {
  notificationId?: [ long ](name='NotificationId'),
  targetHandleState?: string(name='TargetHandleState'),
}

model UpdateNotificationsHandleStateResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateNotificationsHandleStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateNotificationsHandleStateResponseBody(name='body'),
}

async function updateNotificationsHandleStateWithOptions(request: UpdateNotificationsHandleStateRequest, runtime: Util.RuntimeOptions): UpdateNotificationsHandleStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.notificationId)) {
    query['NotificationId'] = request.notificationId;
  }
  if (!Util.isUnset(request.targetHandleState)) {
    query['TargetHandleState'] = request.targetHandleState;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateNotificationsHandleState',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateNotificationsHandleState(request: UpdateNotificationsHandleStateRequest): UpdateNotificationsHandleStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateNotificationsHandleStateWithOptions(request, runtime);
}

model UpdateOwnedLocalJoinPermissionRequest {
  classMode?: string(name='ClassMode'),
  dataRate?: string(name='DataRate'),
  freqBandPlanGroupId?: long(name='FreqBandPlanGroupId'),
  iotInstanceId?: string(name='IotInstanceId'),
  joinEui?: string(name='JoinEui'),
  joinPermissionId?: string(name='JoinPermissionId'),
  joinPermissionName?: string(name='JoinPermissionName'),
  rxDelay?: string(name='RxDelay'),
}

model UpdateOwnedLocalJoinPermissionResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateOwnedLocalJoinPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateOwnedLocalJoinPermissionResponseBody(name='body'),
}

async function updateOwnedLocalJoinPermissionWithOptions(request: UpdateOwnedLocalJoinPermissionRequest, runtime: Util.RuntimeOptions): UpdateOwnedLocalJoinPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.classMode)) {
    query['ClassMode'] = request.classMode;
  }
  if (!Util.isUnset(request.dataRate)) {
    query['DataRate'] = request.dataRate;
  }
  if (!Util.isUnset(request.freqBandPlanGroupId)) {
    query['FreqBandPlanGroupId'] = request.freqBandPlanGroupId;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.joinEui)) {
    query['JoinEui'] = request.joinEui;
  }
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  if (!Util.isUnset(request.joinPermissionName)) {
    query['JoinPermissionName'] = request.joinPermissionName;
  }
  if (!Util.isUnset(request.rxDelay)) {
    query['RxDelay'] = request.rxDelay;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateOwnedLocalJoinPermission',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateOwnedLocalJoinPermission(request: UpdateOwnedLocalJoinPermissionRequest): UpdateOwnedLocalJoinPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateOwnedLocalJoinPermissionWithOptions(request, runtime);
}

model UpdateOwnedLocalJoinPermissionEnablingStateRequest {
  enabled?: boolean(name='Enabled'),
  iotInstanceId?: string(name='IotInstanceId'),
  joinPermissionId?: string(name='JoinPermissionId'),
}

model UpdateOwnedLocalJoinPermissionEnablingStateResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateOwnedLocalJoinPermissionEnablingStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateOwnedLocalJoinPermissionEnablingStateResponseBody(name='body'),
}

async function updateOwnedLocalJoinPermissionEnablingStateWithOptions(request: UpdateOwnedLocalJoinPermissionEnablingStateRequest, runtime: Util.RuntimeOptions): UpdateOwnedLocalJoinPermissionEnablingStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.iotInstanceId)) {
    query['IotInstanceId'] = request.iotInstanceId;
  }
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateOwnedLocalJoinPermissionEnablingState',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateOwnedLocalJoinPermissionEnablingState(request: UpdateOwnedLocalJoinPermissionEnablingStateRequest): UpdateOwnedLocalJoinPermissionEnablingStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateOwnedLocalJoinPermissionEnablingStateWithOptions(request, runtime);
}

model UpdateRoamingJoinPermissionRequest {
  dataRate?: string(name='DataRate'),
  joinPermissionId?: string(name='JoinPermissionId'),
  joinPermissionName?: string(name='JoinPermissionName'),
  rxDelay?: string(name='RxDelay'),
}

model UpdateRoamingJoinPermissionResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateRoamingJoinPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateRoamingJoinPermissionResponseBody(name='body'),
}

async function updateRoamingJoinPermissionWithOptions(request: UpdateRoamingJoinPermissionRequest, runtime: Util.RuntimeOptions): UpdateRoamingJoinPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dataRate)) {
    query['DataRate'] = request.dataRate;
  }
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  if (!Util.isUnset(request.joinPermissionName)) {
    query['JoinPermissionName'] = request.joinPermissionName;
  }
  if (!Util.isUnset(request.rxDelay)) {
    query['RxDelay'] = request.rxDelay;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRoamingJoinPermission',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateRoamingJoinPermission(request: UpdateRoamingJoinPermissionRequest): UpdateRoamingJoinPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRoamingJoinPermissionWithOptions(request, runtime);
}

model UpdateRoamingJoinPermissionEnablingStateRequest {
  enabled?: boolean(name='Enabled'),
  joinPermissionId?: string(name='JoinPermissionId'),
}

model UpdateRoamingJoinPermissionEnablingStateResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateRoamingJoinPermissionEnablingStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateRoamingJoinPermissionEnablingStateResponseBody(name='body'),
}

async function updateRoamingJoinPermissionEnablingStateWithOptions(request: UpdateRoamingJoinPermissionEnablingStateRequest, runtime: Util.RuntimeOptions): UpdateRoamingJoinPermissionEnablingStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.enabled)) {
    query['Enabled'] = request.enabled;
  }
  if (!Util.isUnset(request.joinPermissionId)) {
    query['JoinPermissionId'] = request.joinPermissionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRoamingJoinPermissionEnablingState',
    version = '2019-03-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateRoamingJoinPermissionEnablingState(request: UpdateRoamingJoinPermissionEnablingStateRequest): UpdateRoamingJoinPermissionEnablingStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRoamingJoinPermissionEnablingStateWithOptions(request, runtime);
}

